package com.kiven.classProperty;

public class StaticBlock {
	public static void main(String[] args){
		Parent p;
		System.out.println("========================");
		p = new Parent();
	}
	}
class Parent {
	private static int p1 = staticPrintInt("P....初始化父类静态属性", 100);
	private int p2 = instancePrintInt("P....初始化父类实例属性", 200);
	
	static{
		System.out.println("P....执行父类静态代码段");
	}
	
	{
		System.out.println("P....执行父类非静态代码段");
	}
	
	public Parent(){
		System.out.println("P....父类构造器");
		publicPrintProperty();
		privatePrintProperty();
	}
	
	public static int staticPrintInt(String str, int value){
		System.out.println(str);
		return value;
	}
	
	public int instancePrintInt(String str, int value){
		System.out.println(str);
		return value;
	}
	
	public void publicPrintProperty(){
		System.out.println("P....Parent public 方法");
		System.out.println("P....p1 =" + p1);
		System.out.println("P....p2 =" + p2);
	}
	
	private void privatePrintProperty(){
		System.out.println("P....Parent private 方法");
		System.out.println("P....p1 =" + p1);
		System.out.println("P....p2 =" + p2);
	}
	
}
